using System;
using SpellCenter.Core;

namespace SpellCenter.UI
{
    /// <summary>
    /// Interface for all threaded jobs that deserve progress bars 
    /// </summary>
    public interface IJobManager
    {
        event EventHandler<EventArgs> Finished;
    }

    /// <summary>
    /// Describes a class that will oversee an indexing job
    /// </summary>
    public interface IIndexingManager : IJobManager
    {
        /// <summary>
        /// Creates an object representing an index.  May be fully initialized or in the process of
        /// being initialized in a separate thread.
        /// </summary>
        /// <param name="config">configuration object used to initialize the index</param>
        /// <returns>a non-null CorpusIndex object</returns>
        CorpusIndex BeginIndexing(FilesInCorpusList config);
    }

    public interface ISpellingChangeManager : IJobManager
    {
        /// <summary>
        /// Change the spelling of a word
        /// </summary>
        /// <param name="index"></param>
        /// <param name="word">old spelling</param>
        /// <param name="newWord">new spelling</param>
        void ChangeSpelling(CorpusIndex index, string word, string newWord);
    }
}